package com.comum.javahomework420242025.repository;

import com.comum.javahomework420242025.pojo.CompanyInfo;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

public interface CompanyInfoRepository extends JpaRepository<CompanyInfo, Long> {


    // 模糊匹配id、name和score字段
    @Query("SELECT c FROM CompanyInfo c WHERE " +
            "LOWER(c.title) LIKE %:state% OR " +
            "LOWER(c.type) LIKE %:state% OR " +
            "LOWER(c.comment) LIKE %:state%")
    Page<CompanyInfo> list(@Param("state") String state, Pageable pageable);
}